﻿

var aaa = "#fUI/UIWindow/AriantMatch/characterIcon/5#";
var yun = "#fUI/UIWindow/Megaphone/2#";////红沙漏
var yun2 = "#fUI/UIWindow/Quest/icon8/0#";////蓝指标
var yun8 = "#fUI/UIWindow/MonsterBook/arrowLeft/normal/0#";////金左指标
var yun9 = "#fUI/UIWindow/MonsterBook/arrowRight/normal/0#";////金右指标
var yun4 = "#fUI/UIWindow/Quest/reward#";////奖励
var ttt = "#fUI/UIWindow/Quest/icon2/7#";//"+ttt+"//美化1
var ttt2 = "#fUI/UIWindow/Quest/icon6/7#";////美化2
var ttt3 = "#fUI/UIWindow/Quest/icon3/6#";//"+ttt3+"//美化圆
var ttt4 = "#fUI/UIWindow/Quest/icon5/1#";//"+ttt4+"//美化New
var ttt5 = "#fUI/UIWindow/Quest/icon0#";////美化!
var ttt7 = "#fUI/Basic/BtHide3/mouseOver/0#";//"+ttt6+"//美化会员
var ttt6 = "#fUI/UIWindow.img/PvP/Scroll/enabled/next2#";
var epp = "#fEffect/CharacterEff/1082312/0/0#";  //彩光
var eff = "#fCharacter/Weapon/01702523.img/48/straight/0/effect#"; //彩虹带
var eff = "#fEffect/CharacterEff/1112905/0/1#"; //
var epp = "#fEffect/CharacterEff/1082312/0/0#";  //彩光
var epp1 = "#fEffect/CharacterEff/1082312/2/0#"; //彩光1
var axx = "#fEffect/CharacterEff/1051294/0/0#";  //爱心
var xxx = "#fEffect/CharacterEff/1082565/2/0#"; //星系
var ppp = "#fEffect/CharacterEff/1112907/4/0#"; //泡炮 
var epp3 = "#fEffect/CharacterEff/1112908/0/1#";  //彩光3
var axx1 = "#fEffect/CharacterEff/1062114/1/0#";  //爱心
var zs = "#fEffect/CharacterEff/1112946/2/0#";  //砖石粉
var zs1 = "#fEffect/CharacterEff/1112946/1/1#";  //砖石蓝
var dxxx = "#fEffect/CharacterEff/1102232/2/0#"; //星系
var tz = "#fEffect/CharacterEff/1082565/2/0#";  //兔子蓝
var tz1 = "#fEffect/CharacterEff/1082565/4/0#";  //兔子粉
var tz7 = "#fEffect/CharacterEff/1112900/3/1#";  //音符红
var tz8 = "#fEffect/CharacterEff/1112900/4/1#";  //音符绿
var tz88 = "#fEffect/CharacterEff/1112900/5/1#";  //音符绿!
var yun1 = "#fUI/UIWindow/Quest/icon7/10#";////红色圆
var tz9 = "#fEffect/CharacterEff/1112902/0/0#";  //蓝心
var tz10 = "#fEffect/CharacterEff/1112903/0/0#";  //红心
var tz11 = "#fEffect/CharacterEff/1112904/0/0#";  //彩心
var tz12 = "#fEffect/CharacterEff/1112924/0/0#";  //黄星
var tz13 = "#fEffect/CharacterEff/1112925/0/0#";  //蓝星
var tz14 = "#fEffect/CharacterEff/1112926/0/0#";  //红星
var tz15 = "#fEffect/CharacterEff/1112949/0/0#";  //花样音符
var tz16 = "#fEffect/CharacterEff/1112949/1/0#";  //花样音符
var tz17 = "#fEffect/CharacterEff/1112949/2/0#";  //花样音符
var tz18 = "#fEffect/CharacterEff/1112949/3/0#";  //花样音符
var tz19 = "#fEffect/CharacterEff/1112949/4/0#";  //花样音符
var tz20 = "#fEffect/CharacterEff/1114000/1/0#";  //红星花
var IconA = "#fUI/UIMiniGame/starPlanetRPS/heart#";//红心桃心
var xx = "#fEffect/CharacterEff/1082565/4/0#";
var status = 0;
var typed=0;
var rmb = 0;
var yj = java.lang.Math.floor(Math.random() * 1+4);
var ej = java.lang.Math.floor(Math.random() * 3+5);
var sj = java.lang.Math.floor(Math.random() * 5+10);

function start() {
	status = -1;
	action(1, 0, 0);
}

function action(mode, type, selection) {
	if (mode == -1) {
		cm.dispose();
	} else {
		if (mode == 0 && status == 0) {
			cm.dispose();
			return;
		}
		if (mode == 1)
			status++;
		else
			status--;
		if (status == 0) {
         var str = "" + epp + "" + epp + "" + epp + "" + epp + "\r\n";
        str += "#e#d                  " + xx + "戒指升级" + xx + "\r\n";
		str += "" + epp + "" + epp + "" + epp + "" + epp + "\r\n";
            var x = 0;
        //str += "#r#L1#"+xxx+"#v1112676#升级成#v1112677##r#l\r\n";
        str += "#L1#"+xx+"#v1112676#升级成#v1112677##r#l  #L2#"+xxx+"#v1112677#升级成#v1112678##r#l\r\n";
		str += "#L3#"+xx+"#v1112678#升级成#v1112679##r#l\r\n\r\n";
        str += "           #L4#"+xxx+"#e#r领取普通戒指#l\r\n";
        //str += "#L4#"+xx+"#e#r购买高级鱼饵#r（高级鱼饵2倍概率获得好东西！）#b#l\r\n";
        //str += "#L3#"+xxx+"#e#r使用各种鱼兑换成积分#b\r\n";
		//str += "#L4#"+xx+"#e#r本次比赛积分排名#b#l   #e#r#L7#"+xx+"每月钓鱼大赛奖励#l\r\n";
		str +="\r\n";
        str +="\r\n";;
		str += "\r\n" + epp + "" + epp + "" + epp + "" + epp + ""
        cm.sendSimple(str);
		} else if (status == 1) {
			            if (selection == 1) {
				typed=1;
				 cm.sendYesNo("戒指需要放在背包里才能升级\r\n\r\n#r#v1112676#升级成#v1112677#\r\n#r需要戒指放在背包里\r\n#v4000704##t4000704#：\t\t#r " + cm.itemQuantity(4000704) + " / 300 个\r\n#v4000710##t4000710#：\t\t#r " + cm.itemQuantity(4000710) + " / 300 个\r\n#v4000483##t4000483#：\t\t#r " + cm.itemQuantity(4000483) + " / 300 个\r\n#v4000493##t4000493#：\t\t#r " + cm.itemQuantity(4000493) + " / 300 个\r\n#v4000595##t4000595#：\t\t#r " + cm.itemQuantity(4000595) + " / 300 个#k\r\n\r\n- #e#d管理提示：#n#b点是进行晋级。点否返回上一页.#k");
			            } else if (selection == 2) {
				typed=2;
				cm.sendYesNo("戒指需要放在背包里才能升级\r\n\r\n#r#v1112677#升级成#v1112678#\r\n#r需要戒指放在背包里\r\n#v4000028##t4000028#：\t\t#r " + cm.itemQuantity(4000028) + " / 400 个\r\n#v4000027##t4000027#：\t\t#r " + cm.itemQuantity(4000027) + " / 400 个\r\n#v4000660##t4000660#：\t\t#r " + cm.itemQuantity(4000660) + " / 400 个\r\n#v4000080##t4000080#：\t\t#r " + cm.itemQuantity(4000080) + " / 400 个\r\n#v4000287##t4000287#：\t\t#r " + cm.itemQuantity(4000287) + " / 400 个#k\r\n\r\n- #e#d管理提示：#n#b点是进行晋级。点否返回上一页.#k");
                        } else if (selection == 3) {
				typed=3;
				cm.sendYesNo("戒指需要放在背包里才能升级\r\n\r\n#r#v1112678#升级成#v1112679#\r\n#r需要戒指放在背包里\r\n#v4000831##t4000831#：\t\t#r " + cm.itemQuantity(4000831) + " / 500 个\r\n#v4000644##t4000644#：\t\t#r " + cm.itemQuantity(4000644) + " / 500 个\r\n#v4000828##t4000828#：\t\t#r " + cm.itemQuantity(4000828) + " / 500 个\r\n#v4000834##t4000834#：\t\t#r " + cm.itemQuantity(4000834) + " / 500 个\r\n#v4000836##t4000836#：\t\t#r " + cm.itemQuantity(4000836) + " / 500 个#k\r\n\r\n- #e#d管理提示：#n#b点是进行晋级。点否返回上一页.#k");
                        } else if (selection == 4) {
				typed=4;
				cm.sendYesNo("- #e#r没有戒指的玩家或者不小心把戒指扔了可以在这里重新领取哦#k\r\n\r\n- #e#d管理提示：#n#b点是进行晋级。点否返回上一页.#k");	
                        } else if (selection == 5) {
				typed=5;
				cm.sendYesNo("- #e#r勋章需要放在背包里升级\r\n#g等级需要达到250级\r\n#b需要#t4033248#：\t\t#r " + cm.itemQuantity(4033248) + " / 2000 个\r\n#b需要#t4001832#：\t\t#r" + cm.itemQuantity(4001832) + " / 2000 个\r\n#b需要#t4002003#：\t\t#r" + cm.itemQuantity(4002003) + " / 30 个\r\n#b需要#t4310030#：\t\t#r" + cm.itemQuantity(4310030) + " / 5000 个\r\n#b需要#t4310036#：\t\t#r" + cm.itemQuantity(4310036) + " / 15000 个\r\n#b需要#t4310057#：\t\t#r" + cm.itemQuantity(4310057) + " / 60 个\r\n#b需要#t4033356#：\t\t#r" + cm.itemQuantity(4033356) + " / 20 个\r\n#b需要#t1142317#：\t#r" + cm.itemQuantity(1142317) + " / 1 个#k\r\n\r\n- #e#d管理提示：#n#b点是进行晋级。点否返回上一页.#k");
                       } else if (selection == 14) {
				typed=14;
				cm.sendYesNo("- #e#d法弗纳双风翼弩需要的材料：#n#k\r\n\r\n#b需要#t4021012#：\t\t\t\t #r " + cm.itemQuantity(4021012) + " / 30 个\r\n#b需要#t4021010#： \t\t\t\t\t\t#r" + cm.itemQuantity(4021010) + " / 30 个\r\n#b需要#t4021011#： \t\t\t\t  #r" + cm.itemQuantity(4021011) + " / 30 个\r\n#b需要#t4000082#： \t\t\t\t  #r" + cm.itemQuantity(4000082) + " / 400 个\r\n#b需要#t4000124#：\t\t\t#r" + cm.itemQuantity(4000124) + " / 50 个\r\n#b需要#t4310015#：\t\t\t\t\t\t#r" + cm.itemQuantity(4310015) + " / 3 个\r\n#b需要#t4021019#：\t\t\t\t\t\t  #r" + cm.itemQuantity(4021019) + " / 1 个\r\n#b需要#t4033356#：\t\t\t\t\t   #r" + cm.itemQuantity(4033356) + " / 50 个\r\n#b需要#t4310030#： \t\t\t\t\t\t#r" + cm.itemQuantity(4310030) + " / 5000 个#k\r\n\r\n- #e#d管理提示：#n#b点是进行晋级。点否返回上一页.#k");
			}
		} else if (status == 2) {
			if(typed==1){
                //字母突破 cm.haveItem(hdid) || cm.getPlayer().getMedalText().indexOf("埃苏莱布斯亡命剑")!=-11
                if (cm.haveItem(1112676, 1) && cm.haveItem(4000493, 300) && cm.haveItem(4000595, 300) && cm.haveItem(4000483, 300) && cm.haveItem(4000710, 300) && cm.haveItem(4000704, 300)  && cm.getSpace(1) >= 2) {
                        //cm.removeSlot(-1,-11,1);//这个是把身上的武器删除了
                        cm.gainItem(1112676, -1);
                        cm.gainItem(4000704, -300);
                        cm.gainItem(4000493, -300);
                        cm.gainItem(4000595, -300);
                        cm.gainItem(4000483, -300);
						cm.gainItem(4000710, -300);
					    var ii = cm.getItemInfo();
			            var toDrop = cm.getNewEquip(1112677); // 生成一个Equip类 耳环                 
                        toDrop.setStr(20); //装备力量
			            toDrop.setDex(20); //装备敏捷
			            toDrop.setInt(20); //装备智力
			            toDrop.setLuk(20); //装备运气
			            toDrop.setMatk(20); //物理攻击
			            toDrop.setWatk(20); //魔法攻击 
                        toDrop.setOwner("新手神器");//签名
                        toDrop.setBossDamage(yj);//Boss攻击百分比%
                        toDrop.setIgnorePDR(yj);//无视怪物防御
                        toDrop.setTotalDamage(yj);//总伤害
						cm.addFromDrop(toDrop);
						//cm.setEventCount("十字军戒指进化", 1);
                        cm.sendOk("#b戒指升级成功.\r\n\r\n恭喜您成功将铜十字戒指升级成银十字戒指，戒指还能继续升级哦，要努力哦，#b.");
			            cm.getMap().startMapEffect("恭喜玩家 "+cm.getChar().getName()+" 将戒指升级到第一形态银十字戒指", 5121027);
                        cm.worldSpouseMessage(0x05, "[戒指成长] 恭喜玩家 " + cm.getChar().getName() + "将戒指升级到第一形态银十字戒指，戒指还能继续升级，要努力哦。");
                    } else {
			            cm.sendOk("晋级失败：  #e#r#v1112676#需要戒指放在背包里\r\n#v4000704##t4000704#：\t\t#r " + cm.itemQuantity(4000704) + " / 300 个\r\n#v4000710##t4000710#：\t\t#r " + cm.itemQuantity(4000710) + " / 300 个\r\n#v4000483##t4000483#：\t\t#r " + cm.itemQuantity(4000483) + " / 300 个\r\n#v4032373##t4032373#：\t\t#r " + cm.itemQuantity(4032373) + " / 300 个\r\n#v4000595##t4000595#：\t\t#r " + cm.itemQuantity(4000595) + " / 300 个#k");
			            cm.dispose();
				}   
			} else if(typed==2){
                var vvv = Math.floor(Math.random() * 2);
                if (cm.haveItem(1112677, 1) && cm.haveItem(4000028, 400) && cm.haveItem(4000027, 400) && cm.haveItem(4000660, 400) && cm.haveItem(4000080, 400) && cm.haveItem(4000287, 400)  && cm.getSpace(1) >= 2) {
                    
                    if (cm.haveItem(1112677) > 1) {
                        cm.sendOk("#b抱歉玩家 您没有#v1112677# 不可以升级");
                        cm.dispose();
                        return;
                    }
					if (vvv == 1) {//渡鸦之魂短刀
                        cm.gainItem(1112677, -1);
                        cm.gainItem(4000028, -400);
                        cm.gainItem(4000027, -400);
                        cm.gainItem(4000660, -400);
                        cm.gainItem(4000080, -400);
						cm.gainItem(4000287, -400);
					    var ii = cm.getItemInfo();
			            var toDrop = cm.getNewEquip(1112678); // 生成一个Equip类 耳环                 
                        toDrop.setStr(25); //装备力量
			            toDrop.setDex(25); //装备敏捷
			            toDrop.setInt(25); //装备智力
			            toDrop.setLuk(25); //装备运气
			            toDrop.setMatk(25); //物理攻击
			            toDrop.setWatk(25); //魔法攻击 
                        toDrop.setOwner("新手神器");//签名
                        toDrop.setBossDamage(ej);//Boss攻击百分比%
                        toDrop.setIgnorePDR(ej);//无视怪物防御
                        toDrop.setTotalDamage(ej);//总伤害
						cm.addFromDrop(toDrop);
						//cm.setEventCount("十字军戒指进化", 1);
                        cm.sendOk("#b戒指升级成功.\r\n\r\n恭喜您成功将银十字戒指升级成金十字戒指，戒指还能继续升级，要努力哦，#b.");
			            cm.getMap().startMapEffect("恭喜玩家 "+cm.getChar().getName()+" 将戒指升级到第二形态金十字戒指", 5121027);
                        cm.worldSpouseMessage(0x05, "[戒指成长] 恭喜玩家 " + cm.getChar().getName() + "将戒指升级到第二形态金十字戒指，戒指还能继续升级，要努力哦。");
                    } else {
                        cm.gainItem(4000028, -200);
                        cm.gainItem(4000027, -200);
                        cm.gainItem(4000660, -200);
                        cm.gainItem(4000080, -200);
						cm.gainItem(4000287, -200);
			            cm.sendOk("晋级失败：  #e#r第二阶段升级概率为80%，很遗憾的告诉您升级失败，回收一半材料，继续努力收集材料吧#k");                    
						}
                    cm.dispose();
                } else {
                    cm.sendOk("#b晋级失败： \r\n\r\n#r#v1112678#需要放在背包里\r\n#r需要戒指放在背包里\r\n#v4000028##t4000028#：\t\t#r " + cm.itemQuantity(4000028) + " / 400 个\r\n#v4000027##t4000027#：\t\t#r " + cm.itemQuantity(4000027) + " / 400 个\r\n#v4000660##t4000660#：\t\t#r " + cm.itemQuantity(4000660) + " / 400 个\r\n#v4000080##t4000080#：\t\t#r " + cm.itemQuantity(4000080) + " / 400 个\r\n#v4000287##t4000287#：\t\t#r " + cm.itemQuantity(4000287) + " / 400 个#k");
                    cm.dispose();
                }
			} else if(typed==3){
                var vvv = Math.floor(Math.random() * 6);
                if ( cm.haveItem(1112678, 1) && cm.haveItem(4000836, 499) && cm.haveItem(4000834, 499) && cm.haveItem(4000828, 499) && cm.haveItem(4000644, 499) && cm.haveItem(4000831, 499)  && cm.getSpace(1) >= 1) {
                    
                    if (cm.haveItem(1112678) > 1) {
                        cm.sendOk("#b抱歉玩家 您没有#v1112678# 不可以升级");
                        cm.dispose();
                        return;
                    }
						if (vvv == 1) {//渡鸦之魂短刀
                        cm.gainItem(1112678, -1);
                        cm.gainItem(4000836, -500);
                        cm.gainItem(4000834, -500);
                        cm.gainItem(4000828, -500);
                        cm.gainItem(4000644, -500);
						cm.gainItem(4000831, -500);
					    var ii = cm.getItemInfo();
			            var toDrop = cm.getNewEquip(1112679); // 生成一个Equip类 耳环                  
                        toDrop.setStr(40); //装备力量
			            toDrop.setDex(40); //装备敏捷
			            toDrop.setInt(40); //装备智力
			            toDrop.setLuk(40); //装备运气
			            toDrop.setMatk(40); //物理攻击
			            toDrop.setWatk(40); //魔法攻击 
                        toDrop.setOwner("新手神器");//签名
                        toDrop.setBossDamage(sj);//Boss攻击百分比%
                        toDrop.setIgnorePDR(sj);//无视怪物防御
                        toDrop.setTotalDamage(sj);//总伤害
						cm.addFromDrop(toDrop);
						//cm.setEventCount("十字军戒指进化", 1);
                        cm.sendOk("#b戒指升级成功.\r\n\r\n恭喜您成功将铜十字戒指升级成银十字戒指，戒指还能继续升级哦，要努力哦，#b.");
			            cm.getMap().startMapEffect("恭喜玩家 "+cm.getChar().getName()+" 将戒指升级到最高级形态白金十字戒指", 5121053);
                        cm.worldSpouseMessage(0x05, "[戒指成长] 恭喜玩家 " + cm.getChar().getName() + " 经过不懈的努力成功将戒指升级到最高级形态白金十字戒指，");
                    } else {
                        cm.gainItem(4000836, -300);
                        cm.gainItem(4000834, -300);
                        cm.gainItem(4000828, -300);
                        cm.gainItem(4000644, -300);
						cm.gainItem(4000831, -300);
			            cm.sendOk("晋级失败：  #e#r最终阶段升级概率为60%，很遗憾的告诉您升级失败，回收300份材料，继续努力收集材料吧#k");
						}
                    cm.dispose();
                } else {
                    cm.sendOk("#b升级失败\r\n\r\n#r#v1112678#需要放在背包里\r\n#v4000831##t4000831#：\t\t#r " + cm.itemQuantity(4000831) + " / 500 个\r\n#v4000644##t4000644#：\t\t#r " + cm.itemQuantity(4000644) + " / 500 个\r\n#v4000828##t4000828#：\t\t#r " + cm.itemQuantity(4000828) + " / 500 个\r\n#v4000834##t4000834#：\t\t#r " + cm.itemQuantity(4000834) + " / 500 个\r\n#v4000836##t4000836#：\t\t#r " + cm.itemQuantity(4000836) + " / 500 个#k");
                    cm.dispose();
                }
			} else if(typed==4){
                if (cm.haveItem(1112676) < 1 && cm.haveItem(1112677) < 1 && cm.haveItem(1112678) < 1 && cm.haveItem(1112679) < 1) {
					cm.gainItem(1112676, 1);
			cm.getMap().startMapEffect("恭喜玩家 "+cm.getChar().getName()+" 领取新手戒指", 5121053);
			cm.worldSpouseMessage(0x05, "『新手神器戒指』 : 恭喜玩家 " + cm.getChar().getName() + " 领取新手戒指成功，新手戒指可以继续升级哦");
			cm.dispose();
                } else {
			cm.sendOk("领取戒指失败：  #e#r请确认你的背包如果有以下戒指不能领取\r\n\r\n#b背包存在戒指#t1112676#：\t\t#r " + cm.itemQuantity(1112676) + " / 1 个\r\n#b背包存在戒指#t1112677#：\t\t#r " + cm.itemQuantity(1112677) + " / 1 个\r\n#b背包存在戒指#t1112678#：\t\t#r " + cm.itemQuantity(1112678) + " / 1 个\r\n#b背包存在戒指#t1112679#：\t\t#r " + cm.itemQuantity(1112679) + " / 1 个#k");
			cm.dispose();
				}
			} else if(typed==14){
                if (cm.haveItem(4310030, 5000) && cm.haveItem(4033356, 50) && cm.getSpace(1) >= 1 && cm.haveItem(4021012, 30) && cm.haveItem(4021010, 30) && cm.haveItem(4021011, 30) && cm.haveItem(4000082, 400) && cm.haveItem(4000124, 50) && cm.haveItem(4310015, 3) && cm.haveItem(4021019, 1)) {
			cm.gainItem(1522094,1);
			cm.gainItem(4310030, -5000);
			cm.gainItem(4001832, -160);
			cm.gainItem(4033356, -50);
			cm.gainItem(4021012, -30);
			cm.gainItem(4021011, -30);
			cm.gainItem(4021010, -30);
			cm.gainItem(4000082, -400);
			cm.gainItem(4000124, -50);
			cm.gainItem(4310015, -3);
			cm.gainItem(4021019, -1);
			cm.sendOk("恭喜您合成法弗纳双风翼弩一把.");
			cm.worldSpouseMessage(0x05, "[任务公告] : 恭喜 " + cm.getChar().getName() + " 在市场<普通服务员>处晋级了法弗纳双风翼弩.");
			cm.dispose();
                } else {
			cm.sendOk("合成失败：\r\n\r\n#b需要#t4021012#：\t\t\t\t #r " + cm.itemQuantity(4021012) + " / 30 个\r\n#b需要#t4021010#： \t\t\t\t\t\t#r" + cm.itemQuantity(4021010) + " / 30 个\r\n#b需要#t4021011#： \t\t\t\t  #r" + cm.itemQuantity(4021011) + " / 30 个\r\n#b需要#t4000082#： \t\t\t\t  #r" + cm.itemQuantity(4000082) + " / 400 个\r\n#b需要#t4000124#：\t\t\t#r" + cm.itemQuantity(4000124) + " / 50 个\r\n#b需要#t4310015#：\t\t\t\t\t\t#r" + cm.itemQuantity(4310015) + " / 3 个\r\n#b需要#t4021019#：\t\t\t\t\t\t  #r" + cm.itemQuantity(4021019) + " / 1 个\r\n#b需要#t4033356#：\t\t\t\t\t   #r" + cm.itemQuantity(4033356) + " / 50 个\r\n#b需要#t4310030#： \t\t\t\t\t\t#r" + cm.itemQuantity(4310030) + " / 5000 个#k");
			cm.dispose();
				}
           }
      }
   }
 }
